function plot_time_residual_1000_200_bpp_dist()
%close all
h = clf;
data_path = 'result/1000_200_10/';
data_name = { 'bpp-dist-1', 'bpp-dist-2', 'bpp-dist-4', 'bpp-dist-8', 'bpp-dist-16'};
linestyle = {'--', '--', '--', '--', '--'};
%eps_output = '/home/tqlong/Dropbox/report/distnmf/paper1/figures/plot_runtime_res_concensus_1000_200.eps';
eps_output = 'c:/users/wk/Dropbox/report/distnmf/paper1/figures/plot_time_residual_1000_200_bpp_dist.eps';
num_core = {'1', '2', '4', '8', '16'};
%period = [40 69];
quality = {10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12]};

for i=1:length(data_name);
    %[x,y] = plot_period([data_path data_name{i}], linestyle{i}, period(i));
    [x,y,h_bpp{i}] = plot_quality([data_path data_name{i}], linestyle{i}, quality{i});
    n = floor(length(x) *3 / 4 + rand*1.1) ;
    text(x(n), y(n), ['\fontsize{16}\bf{' num_core{i} '}'], 'HorizontalAlignment', 'center')
end

data_path = 'result/1000_200_10/';
data_name = { 'anls-ms-1', 'anls-ms-2', 'anls-ms-4',  'anls-ms-8', 'anls-ms-16', };
linestyle = {'-', '-', '-', '-', '-'};
%eps_output = '/home/tqlong/Dropbox/report/distnmf/paper1/figures/plot_runtime_res_concensus_1000_200.eps';
num_core = {'1', '2', '4', '8', '16'};
%period = [40 69];
quality = {10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12], 10.^[3:-1:-12]};

for i=1:length(data_name);
    %[x,y] = plot_period([data_path data_name{i}], linestyle{i}, period(i));
    [x,y,h_anls{i}] = plot_quality([data_path data_name{i}], linestyle{i}, quality{i});
    n = floor(length(x) *3 / 4 + rand*1.1) ;
    text(x(n), y(n), ['\fontsize{16}\bf{' num_core{i} '}'], 'HorizontalAlignment', 'center', 'Color', 'r')
end

set(gca,'XDir','Reverse')
xlabel('residual');
ylabel('runtime (seconds)');
axis([10.^[(-12) 3] 0 45])
legend([h_anls{1} h_bpp{1}], 'ANLS', 'BPP', 'Location', 'SouthEast');
%title('ADMM');

print(h, '-depsc', '-tiff', '-r300', eps_output);


end



